<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>函数重载</title>
</head>
<body>
<script>
    function caculor(a,b){
        if(arguments.length>3){
            return arguments[0]+arguments[1]+arguments[2];
        }else if(arguments.length===2){
            return arguments[0]+arguments[1];
        }
    }
    var a=caculor(12,23,45,67,65);
    console.log(a);//80
</script>
</body>
</html>